#!/usr/bin/python
import os, time, sys, thread

curdir = os.listdir('.')

def convert(filename):
    f = open(filename, 'r')
    lines = f.readlines()
    f.close()
    os.rename(filename, filename+".ori")
    f = open(filename, 'w')
    for l in lines:
        f.write(l.strip('\r\n').strip('\n').strip('\n\r')+os.linesep)
    f.close()
    print '%s converted to "%s"'%(filename,repr(os.linesep))

for f in curdir:
    if f.endswith('.py') or f.endswith('.pyw'):
        convert(f)
